
import axios, {
    type AxiosResponse,
    type InternalAxiosRequestConfig
  } from "axios";

const axiosHelpers = axios.create({
    baseURL: "http://localhost:9991",
    timeout: 5000
  })
  // 通用拦截器类型
    axiosHelpers.interceptors.request.use(
      (config: InternalAxiosRequestConfig) => config,
      (error: unknown) => Promise.reject(error)
    );
  
    axiosHelpers.interceptors.response.use(
      (res: AxiosResponse) => res,
      (error: unknown) => Promise.reject(error)
    );
  
  export { axiosHelpers };